<template>

</template>

<script>
    export default {
        name: 'ClearCache',
        data () {
            return {}
        },
        mounted() {
            sessionStorage.clear();
            sessionStorage.clear();

            layui.use('layer',function(){
                layer.msg('<h2>清除成功</h2> <p id="">页面自动  <router-link :to="{ name: \'Login\'}">跳转</router-link> 等待时间： <b id="wait">3</b></p> ', {icon: 1,shade:0.5});
            })
            let that = this;
            !(function run(wait){
                if(wait <= 0) {
                    that.$router.push({name: 'Login'})
                }else{
                    wait--;
                    setTimeout(function(){
                        document.getElementById("wait").innerHTML = wait;
                        run(wait);
                    },1000);
                }
            })(3);
        }
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
